<template>
  <el-container style="height: 100vh;">
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-menu router unique-opened background-color="#d8c2b3" text-color="#4a4335" active-text-color="#616f84" :default-active="$route.path">
        <el-submenu index="1">
          <template slot="title"><i class="iconfont icon-yonghuliebiao"/>用户管理</template>
          <el-menu-item-group>
            <template slot="title" style="color:#000;">用户</template>
            <el-menu-item index="/users/create"><i class="iconfont icon-useradd"/>新建用户</el-menu-item>
            <el-menu-item index="/users/list"><i class="iconfont icon-yonghuliebiao"/>用户列表</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group>
            <template slot="title">管理员</template>
            <el-menu-item index="/admin_users/create"><i class="iconfont icon-xinjianguanliyuan"/>新建管理员</el-menu-item>
            <el-menu-item index="/admin_users/list"><i class="iconfont icon-guanliyuanliebiao"/>管理员列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="2">
          <template slot="title"><i class="iconfont icon-fenlei-0"/>分类管理</template>
          <el-menu-item-group>
            <el-menu-item index="/categories/create"><i class="iconfont icon-xinjianfenlei"/>新建分类</el-menu-item>
            <el-menu-item index="/categories/list"><i class="iconfont icon-fenleiliebiao
"/>分类列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title"><i class="iconfont icon-wenzhang"/>文章管理</template>
          <el-menu-item-group>
            <template slot="title">分类</template>
            <el-menu-item index="/articles/create"><i class="iconfont icon-xinjianwenzhang-
"/>新建文章</el-menu-item>
            <el-menu-item index="/articles/list"><i class="iconfont icon-page-list
"/>文章列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="4">
          <template slot="title"><i class="iconfont icon-comment-pen"/>评论管理</template>
          <el-menu-item-group>
            <template slot="title">评论</template>
            <el-menu-item index="/comments/create"><i class="iconfont icon-bianji"/>新建评论</el-menu-item>
            <el-menu-item index="/comments/list"><i class="iconfont icon-pinglunliebiao"/>评论列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="5">
          <template slot="title"><i class="iconfont icon-liuyan"/>留言管理</template>
          <el-menu-item-group>
            <template slot="title">评论</template>
            <el-menu-item index="/message/create"><i class="iconfont icon-pinglunbianjiliuyan
"/>编辑留言</el-menu-item>
            <el-menu-item index="/message/list"><i class="iconfont icon-yonghuliebiao1"/>留言列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="6">
          <template slot="title"><i class="iconfont icon-Asset"/>日记管理</template>
          <el-menu-item-group>
            <el-menu-item index=""><i class="iconfont icon-diary11"/>日记列表</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>查看</el-dropdown-item>
            <el-dropdown-item>新增</el-dropdown-item>
            <el-dropdown-item>删除</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <span>王小虎</span>
      </el-header>

      <el-main >
        <router-view :key="$route.path"/>
      </el-main>
    </el-container>
  </el-container>

</template>

<script>
  export default {
    name: "Main",
    data(){
      return{
        isCollapse:true
      }
    }
  }
</script>

<style lang="scss" scoped>
  .el-header {
    background-color:#CCCCCC;
    color: #333;
    line-height: 60px;
  }
  .iconfont{
    padding-right: 5px;
    color: #672f2f;
  }
  .el-aside {
    color: #333;
  }
  .el-menu-item-group__title{
   color: #333333;
  }
  .el-main{
    background-color: #f7f5f1;
  }
</style>
